#
# Win64 barebone makefile for c++ examples.
#
# Simply run make or make clean
# Intend this makefile only as a "batch examples updater" after library modification.
#
# Change vars MINGW and MINREL in accord to your compiler path/release
# Here we link statically libstdc++, this is needed if the dll was not generated by MinGW
#
#                
MINGW    =C:/MinGW64
MINREL   =4.7.1
#
#
CPP      = g++.exe
CC       = gcc.exe
LIBS     = -L"$(MINGW)/lib" -static-libgcc $(MINGW)/lib/gcc/x86_64-w64-mingw32/$(MINREL)/libstdc++.a snap7.lib 
INCS     = -I"$(MINGW)/include" -I"../"
CXXINCS  = -I"$(MINGW)/include" -I"../"
CXXFLAGS = $(CXXINCS) 
CFLAGS   = $(INCS) 
RM       = rm -f

.PHONY: all clean 

all:
	$(CPP) -o client.exe ../client.cpp ../snap7.cpp $(LIBS) $(CXXFLAGS)
	$(CPP) -o server.exe ../server.cpp ../snap7.cpp $(LIBS) $(CXXFLAGS)
	$(CPP) -o srv_resourceless.exe ../srv_resourceless.cpp ../snap7.cpp $(LIBS) $(CXXFLAGS)
	$(CPP) -o apartner.exe ../apartner.cpp ../snap7.cpp $(LIBS) $(CXXFLAGS)
	$(CPP) -o ppartner.exe ../ppartner.cpp ../snap7.cpp $(LIBS) $(CXXFLAGS)

clean: 
	${RM} client.exe 
	${RM} server.exe 
	${RM} srv_resourceless.exe 
	${RM} apartner.exe 
	${RM} ppartner.exe 



